<?php

use think\migration\Seeder;
use think\facade\Db;

class Admin extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run(): void
    {
        if(!Db::name('admin')->where('is_super',1)->find()){
            $data = [
                'account' => 'admin',
                'realname' => '见闻间',
                'password' => 'c6f834d16f878935253892b791a7a237',
                'salt' => '3018',
                'is_super' => 1,
                'status' => 'normal',
                'create_time' => time(),
            ];
            Db::name('admin')->save($data);
        }
       
    }
}
